package org.com.behavioralPattern.interpreterPattern;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/28 10:38
 */
public class Multiply implements ArithmeticExpression {
    private ArithmeticExpression left;
    private ArithmeticExpression right;

    public Multiply(ArithmeticExpression left,ArithmeticExpression right){
        this.left=left;
        this.right=right;
    }

    @Override
    public int interpret(Variables variables) {
        return left.interpret(variables)*right.interpret(variables);
    }
}
